{% extends "base.html" %}
{% block title %}Tester's&nbsp;Paradise{% endblock%}
{% block css %}/static/styles/pages/detail.css{% endblock%}
{% block header %}
<script src="/static/js/jquery.js"></script>
<header class="header">
    <div class="header-cont">
        <a href="/" class="navbar-brand"><b class="test-paradise">Tester's&nbsp;Paradise</b></a>
        <ul class="ant-menu ant-menu-light ant-menu-root ant-menu-horizontal" role="menu">
            {% if type == "video" %}
            <li class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-submenu-selected" role="menuitem">{% else
                %}
            <li class="ant-menu-submenu ant-menu-submenu-horizontal" role="menuitem">{% endif %}
                <div class="ant-menu-submenu-title" aria-expanded="false" aria-haspopup="true">
                    <a href="/sum/?type=video"><span class="ant-badge">视频测试结果</span>
                        <i class="ant-menu-submenu-arrow"></i></a>
                </div>
            </li>
            {% if type == "interface" %}
            <li class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-submenu-selected" role="menuitem">{% else
                %}
            <li class="ant-menu-submenu ant-menu-submenu-horizontal" role="menuitem">{% endif %}
                <div class="ant-menu-submenu-title" aria-expanded="false" aria-haspopup="true">
                    <a href="/sum/?type=interface"><span class="ant-badge">接口测试结果</span>
                        <i class="ant-menu-submenu-arrow"></i></a>
                </div>
            </li>
        </ul>
    </div>
</header>
{% endblock %}
{% block content %}
<script src="/static/js/test.js"></script>

<div class="page-main clearfix">
<p class="subtitle-summary">{% if type == "video" %}视频{% elif type == "interface" %}接口{% endif %}测试结果概览</p>
<table>
    <thead class="ant-table-thead">
    <tr>
        <th class="ant-table-align-center" style="text-align: center;"><span class="ant-table-header-column"><div><span
                class="ant-table-column-title">序号</span><span
                class="ant-table-column-sorter"></span></div></span></th>
        <th class="ant-table-align-center" style="text-align: center;"><span class="ant-table-header-column"><div><span
                class="ant-table-column-title">测试时间</span><span
                class="ant-table-column-sorter"></span></div></span></th>
        <th class="ant-table-align-center" style="text-align: center;"><span class="ant-table-header-column"><div><span
                class="ant-table-column-title">用例总数</span><span
                class="ant-table-column-sorter"></span></div></span></th>
        <th class="ant-table-align-center" style="text-align: center;"><span class="ant-table-header-column"><div><span
                class="ant-table-column-title">通过用例数</span><span
                class="ant-table-column-sorter"></span></div></span></th>
        <th class="ant-table-align-center" style="text-align: center;"><span class="ant-table-header-column"><div><span
                class="ant-table-column-title">通过率</span><span
                class="ant-table-column-sorter"></span></div></span></th>
        <th class="ant-table-align-center ant-table-row-cell-last" style="text-align: center;"><span
                class="ant-table-header-column"><div><span class="ant-table-column-title">备注</span><span
                class="ant-table-column-sorter"></span></div></span></th>
        <th class="ant-table-align-center ant-table-row-cell-last" style="text-align: center;"><span
                class="ant-table-header-column"><div><span class="ant-table-column-title">操作</span><span
                class="ant-table-column-sorter"></span></div></span></th>
    </tr>
    </thead>
    <tbody class="ant-table-tbody">
        {% for each in pagination_instance.items %}
        <tr class="ant-table-row ant-table-row-level-0">
            <td id="sum-id-{{ each.id }}" style="text-align: center;">{{ each.id }}</td>
            <td id="sum-test_datetime-{{ each.id }}" style="text-align: center;">{{ each.test_datetime }}</td>
            <td id="sum-total_num-{{ each.id }}" style="text-align: center;">{{ each.total_num }}</td>
            <td id="sum-success_num-{{ each.id }}" style="text-align: center;" >{{ each.success_num }}</td>

            <td id="sum-success_rate-{{ each.id }}" style="text-align: center;" onclick="isHidden('{{ each.id }}')">{{ (each.success_num / each.total_num * 100) | round(2) }} <i id="iconfont-{{ each.id }}" class="iconfont">&#xe612;</i></td>
                {% if each.remark != None and each.remark != "" %}
            <td id="remark{{ each.id }}" data-remark="{{ each.id }}" class="sum-remark {{ type }}" style="text-align: center;" title="{{ each.remark }}">{{ each.remark | truncate(20, killwords=True, leeway=0) }}</td>
                {% else %}
            <td id="remark{{ each.id }}" data-remark="{{ each.id }}" class="sum-remark {{ type }}" style="text-align: center;" title=""></td>
                {% endif %}
            <td id="sum-operation-{{ each.id }}" style="text-align: center;">
                <a id="edit{{ each.id }}" href="#" onclick="edit({{ each.id }})">编辑</a>
                <a href="/detail/?type={{ type }}&sum_id={{ each.id }}&page=1">详情</a>
            </td>
        </tr>
        <tr class="ant-table-row ant-table-row-level-0" id="test-summary-{{ each.id }}" title="{{ each_test_summary[each.id] }}"></tr>
        {% endfor %}
    </tbody>

</table>

<ul class="ant-pagination ant-table-pagination">
    {% if pagination_instance.has_prev %}
    <li title="上1页" class="ant-pagination-disabled ant-pagination-prev" aria-disabled="true"><a
            href="/sum/?type={{ type }}&page={{ pagination_instance.prev_num }}" class="ant-pagination-item-link"><</a></li>
    {% endif %}

    {% for each in pages %}
    {% if each != None %}
        {% if each == page %}
    <li title="{{ each }}" class="ant-pagination-item ant-pagination-item-{{ each }} ant-pagination-item-active"
        tabindex="0"><a href="/sum/?type={{ type }}&page={{ each }}">{{ each }}</a></li>
        {% else %}
    <li title="{{ each }}" class="ant-pagination-item ant-pagination-item-{{ each }}" tabindex="0"><a
            href="/sum/?type={{ type }}&page={{ each }}">{{ each }}</a></li>
        {% endif %}
    {% else %}
    <li title="更多" tabindex="0" class="ant-pagination-jump-next ant-pagination-jump-next-custom-icon">
        <span class="ant-pagination-item-ellipsis">&hellip;</span>
    </li>
    {% endif %}
    {% endfor %}

    {% if pagination_instance.has_next %}
    <li title="下1页" class="ant-pagination-disabled ant-pagination-prev" aria-disabled="true"><a
            href="/sum/?type={{ type }}&page={{ pagination_instance.next_num }}" class="ant-pagination-item-link">></a></li>
    {% endif %}

</ul>
</div>

{% endblock%}